Fox's Git Mirrors
Node / rns-mirrors / Reticulum-Go.git / files / examples / wasm / vendor / github.com / quic-go / quic-go / internal / ackhandler / ack_eliciting.go
Displaying Raw • Download
examples/wasm/vendor/github.com/quic-go/quic-go/internal/ackhandler/ack_eliciting.go 633735d797cc5f5d48cb2e22e8fd7cd743930daf (633735d7) Text, 906 B
package ackhandler
import "github.com/quic-go/quic-go/internal/wire"
// IsFrameTypeAckEliciting returns true if the frame is ack-eliciting.
func IsFrameTypeAckEliciting(t wire.FrameType) bool {
//nolint:exhaustive // The default case catches the rest.
switch t {
case wire.FrameTypeAck, wire.FrameTypeAckECN:
return false
case wire.FrameTypeConnectionClose, wire.FrameTypeApplicationClose:
return false
default:
return true
}
}
// IsFrameAckEliciting returns true if the frame is ack-eliciting.
func IsFrameAckEliciting(f wire.Frame) bool {
_, isAck := f.(*wire.AckFrame)
_, isConnectionClose := f.(*wire.ConnectionCloseFrame)
return !isAck && !isConnectionClose
}
// HasAckElicitingFrames returns true if at least one frame is ack-eliciting.
func HasAckElicitingFrames(fs []Frame) bool {
for _, f := range fs {
if IsFrameAckEliciting(f.Frame) {
return true
}
}
return false
}
Served by rngit 1.5.4 - Generated in 0.02s